package game.view.employment
{
	import flash.display.MovieClip;
	import flash.events.MouseEvent;
	import flash.geom.Point;
	import flash.text.TextField;
	import game.UIComponent.Button;
	import game.UIComponent.Panel;
	import game.UIComponent.TabButton;
	import game.common.CustomBitmap;
	import game.common.Reflection;
	import game.managers.LanguageManager;
	import game.utils.Utils;
	
	public class EmploymentMenu extends Panel
	{
		private var _playerone:CustomBitmap;
		private var _cook:TabButton;
		private var _employ:TabButton;
		private var _queding:TabButton;
		private var _dengji:TextField;
		private var _shijian:TextField;
		private var _renshu:TextField;
		private var _zongshu:TextField;
		private var _num:int;
		public function EmploymentMenu()
		{
			init();
		}
		override protected function init():void
		{
			_num=0;
			setBgImage("hrPanel",636,559);
			setCenter();			
			close=new Point(560,45);	
			
			_playerone=new CustomBitmap();
			_playerone.source="lineBg2";
			_playerone.x=33;
			_playerone.y=173;
			addChild(_playerone);
			
			
			_dengji=Utils.getCommonTextField(LanguageManager.getWord("guyong.dengji"),15,_playerone.x+150,_playerone.y+15);
			addChild(_dengji);
			
			_shijian=Utils.getCommonTextField(LanguageManager.getWord("guyong.shijian"),15,_dengji.x+75,_playerone.y+15);
			addChild(_shijian);
			
			_renshu=Utils.getCommonTextField("0",20,560,80);
			addChild(_renshu);
			
			_zongshu=Utils.getCommonTextField("/1",20,570,80);
			addChild(_zongshu);
			
			_cook=new TabButton(LanguageManager.getWord(" "),cookclickHandler,"cook");
			_cook.x=_playerone.x+_playerone.width-_cook.width-40;
			_cook.y=_playerone.y+5;	
			addChild(_cook);
			
			_employ=new TabButton(LanguageManager.getWord(" "),cookclickHandler,"employ");
			_employ.x=_playerone.x+_playerone.width-_cook.width;
			_employ.y=_playerone.y+5;	
			addChild(_employ);
	
			_queding=new TabButton(LanguageManager.getWord(" "),cookclickHandler,"gyBtn");
			_queding.x=_playerone.x+_playerone.width-_cook.width-20;
			_queding.y=_playerone.y+300;	
			addChild(_queding);
			
			this.addEventListener(MouseEvent.MOUSE_DOWN,act1_mc);
			this.addEventListener(MouseEvent.MOUSE_UP,act2_mc);
		}
		
		
		private function act1_mc(evt:MouseEvent):void
		{
			if(mouseX>150&&mouseX<400&&mouseY>-100&&mouseY<100)
			{
				this.startDrag();
			}
			
		}
		private function act2_mc(evt:MouseEvent):void
		{
			this.stopDrag();
		}
		
		
		private var _now:TabButton;
		
		private function cookclickHandler(e:MouseEvent):void
		{
			
			var btn:TabButton = e.target as TabButton;
			if(btn == _now) return;
			if(_now)_now.choose = false;
			btn.choose = true;
			_now = btn;
			
			switch(btn){
				case _cook:
					break;
	
			}
			
		}
	}
}